import Vue from 'vue'
import App from './App.vue'
import axios from 'axios'
import router from './router'
import ElementUI from 'element-ui'
import { Loading } from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css'
import store from './store/index'
import * as echarts from 'echarts';
import Cookies from 'js-cookie'
import CryptoJS from "crypto-js";
import VueDirectiveImagePreviewer from 'vue-directive-image-previewer'
import 'vue-directive-image-previewer/dist/assets/style.css'
import './router/permission'
import 'element-ui/lib/theme-chalk/base.css';
import CollapseTransition from 'element-ui/lib/transitions/collapse-transition';


Vue.prototype.$cookie = Cookies;
Vue.config.productionTip = false

Vue.prototype.$echarts = echarts
Vue.prototype.$axios = axios
Vue.use(ElementUI)
Vue.use(VueDirectiveImagePreviewer) //图片查看大图
//配置请求的根路径
axios.defaults.baseURL = '/api'

//过渡动画
Vue.component(CollapseTransition.name, CollapseTransition)

//过滤器
Vue.filter("formatStatus",(status)=>{
	switch(status){
		case 1:
			return '未付款';
		case 2:
			return '待接单';
		case 3:
			return '已接单';
		case 4:
			return '派送中';
		case 5:
			return '已完成';
		case 6:
			return '已取消';
		case 7:
			return '退款';
		default:
			return '???';
	}
})

new Vue({
    el: '#app',
    router,
    store,
    render: h => h(App),
    components: { App },
    template: '<App/>'
}).$mount('#app')